package bsf.baseservice.businessmq.redis.messagelock;

import bsf.base.CallBack;
import bsf.base.TimeSpan;

/**
 接收消息合并
 接收消息处理允许阻塞
 
*/
public class ReceiveMessageLock extends BaseMessageLock
{
	public ReceiveMessageLock(TimeSpan mergetime)
	{
		super(mergetime);

	}
	@Override
	public void lock(CallBack.Func0 action)
	{
		isHaveNewMessage = true;
		if (isLock==false) //判断当前是否并发，并发情况下则跳过，视为请求合并
		{
			lockRun(action); //同步
		}
	}

}